import axios from 'axios'
 const url = process.env.REACT_APP_BASE_URL
axios.defaults.baseURL = url?url:''+'/api'
axios.defaults.headers['content-Type'] = 'application/x-www-form-urlencoded'
//在有token的情况下携带token
axios.defaults.headers.common['token']=localStorage.token
//请求拦截器
axios.interceptors.request.use((config) => {

    return config
})
//响应拦截器
axios.interceptors.response.use(config => { 

    return config
})
export default axios